Skip to content

Conversation

@folkertdev
Copy link
Contributor

tracking issue: #44930

Emit a nice error message on bpf and spirv targets when a c-variadic function is defined. Spirv also does not support c-variadic calls, bpf appears to allow them.

r? @workingjubilee

@folkertdev folkertdev added the F-c_variadic `#![feature(c_variadic)]` label Dec 2, 2025
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 2, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 2, 2025

workingjubilee is currently at their maximum review capacity.
They may take a while to respond.

@folkertdev folkertdev force-pushed the c-variadic-not-supported branch from 2af7dca to 1f9013b Compare December 2, 2025 20:26
@folkertdev folkertdev force-pushed the c-variadic-not-supported branch from 1f9013b to 80a780f Compare December 3, 2025 00:03
@rustbot
Copy link
Collaborator

rustbot commented Dec 3, 2025

These commits modify compiler targets.
(See the Target Tier Policy.)

@folkertdev folkertdev force-pushed the c-variadic-not-supported branch from 80a780f to 695d2fa Compare December 3, 2025 00:06
Comment on lines 1936 to 1938
// We don't know if the target supports c-variadic definitions, but we don't want
// to needlesly restrict custom target.json configurations.
Other(_) => true,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is kind of up for debate, but a custom target.json is kind of "here be dragons" already, and if the new target gets proper compiler support a choice still has to be made here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems fine to me.

variadic_span: variadic_param.span,
target: &*self.sess.target.llvm_target,
});
return;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

emitting other errors here doesn't seem useful when the target just does not support c-variadics.

@rust-log-analyzer

This comment has been minimized.

@folkertdev folkertdev force-pushed the c-variadic-not-supported branch from 695d2fa to fe1855e Compare December 3, 2025 00:36
@rust-log-analyzer

This comment has been minimized.

@folkertdev folkertdev force-pushed the c-variadic-not-supported branch from fe1855e to fc017dd Compare December 3, 2025 10:33
@rustbot
Copy link
Collaborator

rustbot commented Dec 3, 2025

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-c_variadic `#![feature(c_variadic)]` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants